<?php

namespace App\Api\Logistics;

class KChannel
{
    public function __construct()
    {
    }

    /**
     * 物流信息订阅
     * @param $data
     * @return array
     */
    public function supscr($data)
    {
        return ['status' => 1, 'msg' => '成功', 'data' => array()];
    }
    /**
     * 加载通道
     * @param $channelName
     * @return null
     */
    public function loadChannel($channelName)
    {
        $obj = null;

        $channelName = 'App\Api\Logistics\\' . $channelName;

        if (class_exists($channelName)) {
            $obj = new $channelName();
        }

        return $obj;
    }
    public function resMsg($code = 200, $msg = '', $data = [])
    {
        return [
            'status' => $code,
            'msg' => $msg,
            'data' => $data
        ];
    }
}
